package cn.wolfcode.domain;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;

import java.util.HashMap;

@Data
public class Department {
    /** */
    private Long id;

    /** */
    private String name;

    /** */
    private String sn;

    public String getJson() throws JsonProcessingException {
    HashMap<String, Object> map = new HashMap<>();
    map.put("id",id);
    map.put("name",name);
    map.put("sn",sn);
    return new ObjectMapper().writeValueAsString(map);

}

}